package com.miao.elm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miao.elm.dao.FoodDao;
import com.miao.elm.entity.FoodEntity;
import com.miao.elm.service.FoodService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("foodService")
public class FoodServiceImpl extends ServiceImpl<FoodDao, FoodEntity> implements FoodService {

    @Override
    public List<FoodEntity> listFoodByBusinessId(int businessId) {
        return this.baseMapper.selectList(new QueryWrapper<FoodEntity>().eq("business_id", businessId));
    }

    @Override
    public FoodEntity getFoodByFoodId(int foodId){
        return this.baseMapper.selectOne(new QueryWrapper<FoodEntity>().eq("food_id", foodId));
    }
}